<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>药品信息查询</title>
    <style>
        .box{
            width: 100%;
        }
        .box1{
            width: 100%;
            height: 50px;
            background: lavender;
        }

        .btn{
            background: orange;
            color: white;
            border: 0;
            width: 80px;
            height: 30px;
            border-radius: 5px;
        }
        .liang{
            background: crimson;
            color: white;
            border: 0;
            width: 100px;
            height: 30px;
            line-height: 30px;
            border-radius: 5px;
            margin: 10px;
        }
        .sou{
            width: 150px;
            height: 20px;
            border-radius: 3px;
            margin: 10px;
        }
        table{
            margin-top: 15px;
            width: 100%;
            border-collapse: collapse;
            text-align: center;
        }
        th{
            border: 1px solid silver;
        }
        th:active{color: red}
        th:hover{color: red}
        td{
            border: 1px solid silver;
        }
        .kuang{
            margin-left:30%;
            font-family: 宋体;
            font-size: 16px;
            font-weight:bold;
        }
        .lyy{
            width: 1000px;
            height: 30px;
            margin-top: 22%;
            margin-left: 48%;
        }
        .sb{
            border: 0;
            background: #2D93CA;
            margin-top: -3px;
            width: 70px;
            height: 30px;
            border-radius: 5px;
        }
        .zhuan1{
            width: 50px;
            height: 20px;
        }
        .zhuan2{
            border: solid;
            color: #2D93CA;
            font-weight: bold;
            font-size: 20px;
            background: transparent;

            border: 0;
        }
    </style>
    <script src="/resources/js/jquery-1.7.1.min.js" type="application/javascript"></script>
    <script src="/resources/js/jquery-ui-1.8.10.custom.min.js" type="text/css"></script>
</head>

<script >
    $(function () {
        $.getJSON("/selectCategory",{},function (data) {
            $("#leibie").empty();
            var leibie = '<option value="">全部</option>';
            for(var i = 0 ;i < data.length;i++){
                var lei = data[i];
                leibie +='<option value="'+lei.id+'">'+lei.category+'</option>'
            }
            $("#leibie").append(leibie);
        })
        select();
    });
    function jian() {
        var x = $("input[name='zhuan']").val();
        readList(1);
    }
    function select(pageNum) {
        if (pageNum == undefined||pageNum==null) {
            pageNum = 1;
        }

        var formData = new FormData($("#form1")[0]);
        formData.append("pageNum",pageNum) ;
        $.ajax({
            url:"/PageInfoZjyangVO",
            type: "post",
            dataType: "json",
            data: formData,
            processData:false,
            contentType:false,
            success: function (pageInfo) {
                var  bo =  "";
                $.each(pageInfo.list, function (index,item) {
                    bo += '<tr>\n' +
                        '        <th>' + item.serialNumber + '</th>\n' +
                        '        <th>' + item.commonName + '</th>\n' +
                        '        <th>' + item.size + '</th>\n' +
                        '        <th>' + item.dosageForm + '</th>\n' +
                        '        <th>' + item.unit + '</th>\n' +
                        '        <th>' + item.factor + '</th>\n' +
                        '        <th>' + item.productionName + '</th>\n' +
                        '        <th>' + item.commodityName + '</th>\n' +
                        '        <th>' + item.winPrice + '</th>\n' +
                        '        <th>' + item.quality + '</th>\n' +
                        '        <th>' + item.drugCategory + '</th>\n' +
                        '        <th>' + item.transaction + '</th>\n' +
                        '        <th><a href="">详细</a></th>\n' +
                        '        <th><a href="xiugai.html">修改</a></th>\n' +
                        '        <th><a href="">状态</a></th>\n' +
                        '    </tr>';
                    $("#bo").html(bo);
                    $("#pages").empty();
                    var pages=' <li class="im-indexpage"><a href="javaScript:qugongcha('+1+')">首页</a></li>\n' +
                        '        <li class="im-nextpage"><a href="javaScript:qugongcha('+(item.prePage)+')">上一页</a></li>\n' +
                        '        <li class="im-nextpage"><a href="javaScript:qugongcha('+(item.nextPage)+')">下一页</a></li>\n' +
                        '        <li class="im-indexpage"><a href="javaScript:qugongcha('+(item.pages)+')">尾页</a></li>';
                    $("#pages").append(pages);
                })
            }
        })
    }

    var da = "";
    select(1)
    function readList(pageNum) {
        if(pageNum == undefined){
            pageNum = 1;
        }
        var form = $("#form1")[0];
        var formData= new FormData(form);
        formData.append("pageNum",pageNum);
        $.ajax({
            url:"/PageInfoZjyangVO",
            data:formData,
            dataTpe:"json",
            type:"post",
            processData:false,
            contentType:false,
            success:function (date) {
                da = date;
                var tbody ='';
                date.list;
                $("#tbody").empty();
                for (var i =0 ; i<i<date.list;i++){
                    var zjy = date[i];
                    tbody +='<tr>'+
                        '<td>'+zjy.serialNumber+'</td>'+
                        '<td>'+zjy.commonName+'</td>'+
                        '<td>'+zjy.dosageForm+'</td>'+
                        '<td>'+zjy.size+'</td>'+
                        '<td>'+zjy.unit+'</td>'+
                        '<td>'+zjy.factor+'</td>'+
                        '<td>'+zjy.productionName+'</td>'+
                        '<td>'+zjy.commodityName+'</td>'+
                        '<td>'+zjy.quality+'</td>'+
                        '<td>'+zjy.transaction+'</td>'+
                        '</tr>'
                }
                $("#tbody").append(tbody);
            }
        })
    }

</script>
<body>
<div class="box">
    <h3>药品品目查询</h3>
    <hr>
    <form action="" method="post" id="form1">
        <div class="kuang">
            药品流水号:
            <input type="text" value="" class="sou" name="serialNumber"/>
            &nbsp;
            通用名
            <input  class="sou"  value="" name="commonName"/>
            <br/>
            &nbsp;&nbsp;
            规格：
            <input  class="sou" value="" name="dosageForm"/>
            &nbsp;
            剂型：
            <input value="" class="sou" name="size"/>
            <br/>
            &nbsp;&nbsp;
            单位：
            <input  class="sou" value="" name="unit"/>
            转换系数:
            <input  class="sou" value="" name="factor"/>
            <br/>
            &nbsp;
            生产企业:
            <input  class="sou" value="" name="productionName"/>
            商品名:
            <input  class="sou" value="" name="commodityName"/>
            <br/>
            &nbsp;
            价格范围:
            <input type="text" value="" name="min" placeholder="￥" style="width: 60px"  class="layui-input">
            至
            <input type="text" value="" name="max" placeholder="￥" style="width: 60px"  class="layui-input">
            质量层次:
            <select type="text" class="sou" id="leibie1" name="quality">
                <option value="1">国家一类新药</option>
                <option value="2">国家科学进步奖</option>
                <option value="3">专利</option>
                <option value="4">原研</option>
                <option value="5">单独定价</option>
                <option value="6">优质优价</option>
                <option value="7">GMP</option>
            </select>
            <br/>
            &nbsp;
            药品类别:
            <select type="text" class="sou" id="leibie" name="drugCategory" lay-ignore>
                <option value="">全部</option>
            </select>
            &nbsp;
            状态：
            <select type="text"class="sou" id="category2" name="transaction">
                <option value="1">交易正常</option>
                <option value="2">交易异常</option>
            </select>
        </div>
    </form>
    <tbody id="tbody">

    </tbody>
</div>
</hr>
</body>
<div class="box1">
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <button class="liang" onclick="derive">导出</button>&nbsp;&nbsp;
    <button class="liang" onclick="readList()">查询</button>
</div>
<div class="an1">
    <button type="button" 	class="aaa"><a href="tianjia.html">添加</a></button>

    <button type="button2" 	class="aaa"><a href="daoru.html">导入</a></button>
    <table>
        <thead>
        <tr>
            <th>药品流水号</th>
            <th>通用名</th>
            <th>剂型</th>
            <th>规格</th>
            <th>单位</th>
            <th>转换系数</th>
            <th>生产企业</th>
            <th>商品名称</th>
            <th>中标价</th>
            <th>质量层次</th>
            <th>药品类别</th>
            <th>交易状态</th>
            <th>详细</th>
            <th>修改</th>
            <th>状态</th>
        </tr>
        </thead>
        <tbody id="bo">
        <tr>
            <td class="a1"></td>
            <td class="a2"></td>
            <td class="a3"></td>
            <td class="a4"></td>
            <td class="a5"></td>
            <td class="a6"></td>
            <td class="a7"></td>
            <td class="a8"></td>
            <td class="a9"></td>
            <td class="a10"></td>
            <td class="a11"></td>
            <td class="a13"></td>
            <td><button type="button" class="layui-btn1">详细</button></td>
            <td><button type="button" class="layui-btn2">修改</button></td>
            <td><button type="button" class="layui-btn3">状态</button></td>
        </tr>
        </tbody>
    </table>
    <div>
        <ul id="fenye">
            <li class="im-indexpage"><a href="">首页</a></li>
            <li class="im-nextpage"><a href="">上一页</a></li>
            <li class="im-nextpage"><a href="">下一页</a></li>
            <li class="im-indexpage"><a href="">尾页</a></li>
        </ul>
    </div>
</div>
</body>
</html>
